#include <GL/freeglut_std.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include <iostream>
#include <stdio.h>


void init(void)
{
    glClearColor(0.0, 0.0, 0.0, 1.0);
    glMatrixMode(GL_PROJECTION);
}

void pointDisplay(void)
{
   // glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 0.0, 0.0);
    glLoadIdentity();
    glPointSize(10.0);
    glBegin(GL_POINTS);
        glVertex3d(0.0, 0.0, 0.0);
    glEnd();
    //glFlush();
}

void lineDisplay(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(0.0, 1.0, 1.0);
    glLineWidth(3.0);
    glBegin(GL_LINE_LOOP);
        glVertex3d(0.5, 0.0, 0.0);
        glVertex3d(0.0, 0.5, 0.0);
        glVertex3d(-0.5, 0.0, 0.0);
    glEnd();
    glFlush();
}

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
    glutInitWindowSize(300, 300);
    glutInitWindowPosition(100, 100);
    glutCreateWindow("OpenGL");
    init();
    glutDisplayFunc(pointDisplay);
    glutDisplayFunc(lineDisplay);
    glutMainLoop();
}

